package com.assets.menu;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.assets.R;

import java.util.List;

/**
 * Created by Administrator on 2019/4/16.
 */

public class Menu_Adapter extends ArrayAdapter {
    public Menu_Adapter(Context context, int resource, List objects) {
        super(context, resource, objects);
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        Menu_bean linkeMain = (Menu_bean)getItem(position);
        View view = LayoutInflater.from(getContext()).inflate(R.layout.munu_item, null);

        ImageView item = (ImageView)view.findViewById(R.id.item);
        TextView item_name = (TextView)view.findViewById(R.id.item_name);

        item.setImageResource(linkeMain.getItem());
        item_name.setText(linkeMain.getItem_name());
        return view;
    }

}
